#define D2D_INPUT_COUNT 1
#define D2D_INPUT0_SIMPLE
#define D2D_REQUIRES_SCENE_POSITION
#include "d2d1effecthelpers.hlsli"

//半径
float radius;

float2 pos;


D2D_PS_ENTRY(main) {

	float4 color = D2DGetInput(0);
    //当前位置
    float2 cPoint = D2DGetScenePosition().xy;
    float dx = pos.x-cPoint.x;
    float dy =pos.y-cPoint.y;

    float dist = dx*dx+dy*dy;
    // float dist = distance(pos,cPoint);
    if(dist<radius*radius){

        float f =1- dist/(radius*radius);
        f*=0.5;
    return float4(color.r+f,color.g+f,color.b+f,color.a+f);
    }
    else {
        return color;
    }
}


set INCLUDEPATH="%WindowsSdkDir%\Include\%WindowsSDKVersion%\um"

fxc WaveShader.shader /nologo /T lib_4_0_level_9_3_ps_only /D D2D_FUNCTION /D D2D_ENTRY=main /Fl WaveShader.fxlib /I %INCLUDEPATH%

fxc WaveShader.shader /nologo /T ps_4_0_level_9_3 /D D2D_FULL_SHADER /D D2D_ENTRY=main /E main /setprivate WaveShader.fxlib /Fo:WaveShader.txt /I %INCLUDEPATH%

set INCLUDEPATH="%WindowsSdkDir%\Include\%WindowsSDKVersion%\um"
 fxc Liquefaction.shader /nologo /T lib_4_0_level_9_3_ps_only /D D2D_FUNCTION /D D2D_ENTRY=main /Fl Liquefaction.fxlib /I %INCLUDEPATH%
 fxc Liquefaction.shader /nologo /T ps_4_0_level_9_3 /D D2D_FULL_SHADER /D D2D_ENTRY=main /E main /setprivate Liquefaction.fxlib /Fo:Liquefaction.txt /I %INCLUDEPATH%

set INCLUDEPATH="%WindowsSdkDir%\Include\%WindowsSDKVersion%\um"
 fxc LiquefactionAbsoluteSampling.shader /nologo /T lib_4_0_level_9_3_ps_only /D D2D_FUNCTION /D D2D_ENTRY=main /Fl LiquefactionAbsoluteSampling.fxlib /I %INCLUDEPATH%
 fxc LiquefactionAbsoluteSampling.shader /nologo /T ps_4_0_level_9_3 /D D2D_FULL_SHADER /D D2D_ENTRY=main /E main /setprivate LiquefactionAbsoluteSampling.fxlib /Fo:LiquefactionAbsoluteSampling.txt /I %INCLUDEPATH%


 set INCLUDEPATH="%WindowsSdkDir%\Include\%WindowsSDKVersion%\um"
 fxc LiquefactionMapping.shader /nologo /T lib_4_0_level_9_3_ps_only /D D2D_FUNCTION /D D2D_ENTRY=main /Fl LiquefactionMapping.fxlib /I %INCLUDEPATH%
 fxc LiquefactionMapping.shader /nologo /T ps_4_0_level_9_3 /D D2D_FULL_SHADER /D D2D_ENTRY=main /E main /setprivate LiquefactionMapping.fxlib /Fo:LiquefactionMapping.txt /I %INCLUDEPATH%

 set INCLUDEPATH="%WindowsSdkDir%\Include\%WindowsSDKVersion%\um"
 fxc 你的Shader代码文件.shader /nologo /T lib_4_0_level_9_3_ps_only /D D2D_FUNCTION /D D2D_ENTRY=main /Fl 编译后的文件名.fxlib /I %INCLUDEPATH%
 fxc 你的Shader代码文件.shader /nologo /T ps_4_0_level_9_3 /D D2D_FULL_SHADER /D D2D_ENTRY=main /E main /setprivate 编译后的文件名.fxlib /Fo:编译后的文件名.txt /I %INCLUDEPATH%



set INCLUDEPATH="%WindowsSdkDir%\Include\%WindowsSDKVersion%\um"
 fxc Transform.shader /nologo /T lib_4_0_level_9_3_ps_only /D D2D_FUNCTION /D D2D_ENTRY=main /Fl Transform.fxlib /I %INCLUDEPATH%
 fxc Transform.shader /nologo /T ps_4_0_level_9_3 /D D2D_FULL_SHADER /D D2D_ENTRY=main /E main /setprivate Transform.fxlib /Fo:Transform.txt /I %INCLUDEPATH%
